//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;
using System.Text;
using OpenLS.Core;

namespace OpenLS.Spreadsheet.UI.Internals
{
    public class PaperHelper
    {
        public static IEnumerable<PaperSize> PageSizes
        {
            get
            {
                return new[]
                           {
                               PaperSize.Letter,
                               PaperSize.Legal,
                               PaperSize.Statement,
                               PaperSize.Executive,
                               PaperSize.A3,
                               PaperSize.A4,
                               PaperSize.A5,
                               PaperSize.B4,
                               PaperSize.B5,
                               PaperSize.Standard11x17,
                               PaperSize.EnvelopeNumber10,
                               PaperSize.EnvelopeDL,
                               PaperSize.EnvelopeC5,
                               PaperSize.EnvelopeMonarch,
                               PaperSize.JapaneseDoublePostcard,
                               PaperSize.Standard9x11,
                               PaperSize.B5JisTransverse,
                               PaperSize.SixThreeQuartersEnvelope,
                               PaperSize.SixThreeQuartersEnvelope,

                           };
                
            }
        }
        public static IEnumerable<PageMargins> PageMargins
        {
            get
            {
                yield return
                    new PageMargins
                    {
                        Left = FromInches(0.7),
                        Top = FromInches(0.75),
                        Right = FromInches(0.7),
                        Bottom = FromInches(0.75),
                        Header = FromInches(0.3),
                        Footer = FromInches(0.3)
                    };
                yield return
                    new PageMargins
                    {
                        Left = FromInches(1),
                        Top = FromInches(1),
                        Right = FromInches(1),
                        Bottom = FromInches(1),
                        Header = FromInches(0.5),
                        Footer = FromInches(0.5)
                    };
                yield return
                    new PageMargins
                    {
                        Left = FromInches(0.25),
                        Top = FromInches(0.75),
                        Right = FromInches(0.25),
                        Bottom = FromInches(0.75),
                        Header = FromInches(0.3),
                        Footer = FromInches(0.3)
                    };
                
            }
        }

        private static double FromInches(double d)
        {
            return d*96;
        }
    }
}
